#include "StdAfx.h"
#include "AnimationDlgImpl.h"

CAnimationDlgImpl::CAnimationDlgImpl(void)
{
	m_vADC["Ambient"] = CAnimationDiagram("Ambient");
	m_vADC["Diffuse"] = CAnimationDiagram("Diffuse");
	m_vADC["Specular"] = CAnimationDiagram("Specular");
	m_vADC["Emissive"] = CAnimationDiagram("Emissive");
	m_vADC["Opacity"] = CAnimationDiagram("Opacity");
	m_vADC["Glossiness"] = CAnimationDiagram("Glossiness");
	m_vADC["Specular Level"] = CAnimationDiagram("Specular Level");
	m_vADC["RayTrace reflection"] = CAnimationDiagram("RayTrace reflection");
	m_vADC["Index of refraction"] = CAnimationDiagram("Index of refraction");
}

CAnimationDlgImpl::~CAnimationDlgImpl(void)
{
}

VOID CAnimationDlgImpl::ActivateDiagram( const char* name )
{
	CAnimationDiagram& diagram = m_vADC[name];
	if (!diagram.IsValid())
	{
		diagram.Activate();
	}
}

BOOL CAnimationDlgImpl::DrawDiagram() const
{
	return (m_CurrDiagram->second).Draw();
}

VOID CAnimationDlgImpl::DrawFrameOfAxes() const
{

}

VOID CAnimationDlgImpl::SetDiagramToDraw( const char* name )
{
	m_CurrDiagram = m_vADC.find(name);
}

BOOL CAnimationDlgImpl::Draw() const
{
	if ((m_CurrDiagram->second).IsValid())
	{
		DrawFrameOfAxes();
		return DrawDiagram();
	}
	return FALSE;
}